/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package DataSource;

import java.util.Random;

/**
 *
 * @author Tuan
 */
public class Range {
    
    private int sbpMin;
    
    private int sbpMax;
    
    private int dbpMin;
    
    private int dbpMax;
    
    private int hbMin;
    
    private int hbMax;
    
    public Range(int sbpMin, int sbpMax, int dbpMin, int dbpMax, int hbMin, int hbMax){
        this.sbpMax = sbpMax;
        this.sbpMin = sbpMin;
        this.dbpMin = dbpMin;
        this.dbpMax = dbpMax;
        this.hbMin = hbMin;
        this.hbMax = hbMax;
    }
    private Range(){}
    
    public boolean isInRange(int value){
        return value >= sbpMin && value <= sbpMax;
    }
    
    public int generateDbp(int value){
        Random ran = new Random(System.currentTimeMillis());
        return ran.nextInt(dbpMax - dbpMin + 1) + dbpMin;
    }
    
    public int generateHb(int value){
        Random ran = new Random(System.currentTimeMillis());
        return ran.nextInt(hbMax - hbMin + 1) + hbMin;
    }
}
